package com.cn.mapper.dao.db1.bc;


import com.cn.bean.pojo.bc.Mater;
import com.cn.bean.pojo.bc.MaterList;
import com.cn.bean.vo.bc.MateVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MaterialQualityDao {
    //用途分类
    List<Mater> selectUseClassify();
    Mater selectMaterId(@Param("id") int id);

    List<Mater> selectUserClassifyId(@Param("id") String id);
    //搜索上级分类
    Mater selectParentId(@Param("flmc") String flmc);

    //分类数量
    int getClassifyCount();
    Mater selectUseClassifyId (@Param("ytflbh")int ytflbh);

    //用途添加
    int insertClassify(
            @Param("ytflbh") int ytflbh,
            @Param("flmc") String flmc,
            @Param("state") int state,
            @Param("remark") String remark,
            @Param("level") int level,
            @Param("parentBh") int parentBh,
            @Param("lx") int lx);


    //用途分类修改
    int updateClassify(@Param("ytflbh") int ytflbh,
                       @Param("flmc") String flmc,
                       @Param("state") int state,
                       @Param("remark") String remark,
                       @Param("level")int level,
                       @Param("parentBh") int parentBh
    );
    //删除用途分类
    int deleteClassify(@Param("ytflbh") String ytflbh);
    //删除校验子节点
    Integer repeatClassifyParentBh(@Param("ytflbh") int ytflbh);
    //用途分类修改无上级分类
    int updateClfy(@Param("ytflbh") int ytflbh,
                   @Param("flmc") String flmc,
                   @Param("state") int state,
                   @Param("remark") String remark
    );

    //分类重复判定
    Integer repeatFlmc(@Param("flmc") String flmc);
    Integer repeatFlmcLevel(@Param("flmc") String flmc, @Param("level") int level);
    //用途定义
    List<MaterList> selectUseDefinition();
    List<MaterList> selectUseDefinitionId(@Param("id")int id);
    List<MaterList> selectMaterListAll();
    List<MateVo> selectPurposes();


    List<MaterList> selectUseDefinitionFlmc(@Param("flmc") String flmc);

    //查询分类
    Mater selectYtfl(@Param("flmc") String flmc);
    Mater selectId(@Param("id")int id);
    //用途数量
    int getDefinitionCount();

    //添加用途定义
    int insertUseDefinition(
            @Param("ytbm") int ytbm,
            @Param("ytfl") String ytfl,
            @Param("ytmc") String ytmc,
            @Param("state") int state,
            @Param("remark") String remark,
            @Param("level") int level,
            @Param("fq") int fq,
            @Param("parentBh") int parentBh,
            @Param("czzm") String czzm,
            @Param("md") String md,
            @Param("sbm") String sbm,
            @Param("lx") int lx);
    //修改用途
    int updateUseDefinition(  @Param("ytbm") int ytbm,
                              @Param("ytfl") String ytfl,
                              @Param("ytmc") String ytmc,
                              @Param("state") int state,
                              @Param("remark") String remark,
                              @Param("czzm") String czzm,
                              @Param("md") String md,
                              @Param("sbm") String sbm,
                              @Param("fq") int fq);

    // 查询上级用途
    MaterList selectDefinition(@Param("sjyt") String sjyt);

    //用途定义删除
    int deleteDefinition(@Param("ytmc") String ytmc);

    //审核
    int updateState0(@Param("ytmc") String ytmc);

    int updateState1(@Param("ytmc") String ytmc);

    List<MateVo> getPurposes();

    //分页
    List<MaterList> pagination(@Param("limit") int limit, @Param("page") int page);
    //搜索
    List<MaterList> searchPagination(@Param("limit") int limit, @Param("page") int page,@Param("ytmc")String ytmc,@Param("ytbm")String ytbm,@Param("flmc") String flmc);
}
